![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
#include "assert.h"
#include <cstdlib>
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <iostream>
#include <fstream>
#include <time.h>
#include <cmath>
#include <vector>
#include <list>
#include <string>
#include <blitz/array.h>
#include "../BatchALMaSS/ALMaSS_Setup.h"
#include "../ALMaSSDefines.h"
#include "../Landscape/ls.h"
#include "../BatchALMaSS/MovementMap.h"
#include "../BatchALMaSS/BinaryMapBase.h"
#include "../BatchALMaSS/PopulationManager.h"
#include "../Vole/GeneticMaterial.h"
#include "../Skylark/skylarks_all.h"
#include "../Partridge/Partridge_All.h"
#include "../Partridge/Partridge_Population_Manager.h"
#include "../Vole/vole_all.h"
#include "../Vole/VolePopulationManager.h"
#include "../Vole/Predators.h"
#include "../Bembidion/bembidion_all.h"
#include "../Hare/hare_all.h"
#include "../Spider/spider_all.h"
#include "../Spider/SpiderPopulationManager.h"
#include "../MarshFritillary/MarshFritillaryHdrs.h"
#include "../BatchALMaSS/BoostRandomGenerators.h"
#include "../GooseManagement/GooseMemoryMap.h"
#include "../GooseManagement/Goose_Base.h"
#include "../BatchALMaSS/CurveClasses.h"
#include "../Hunters/Hunters_all.h"
#include "../GooseManagement/Goose_Population_Manager.h"
#include "../RoeDeer/Roe_all.h"
#include "../RoeDeer/Roe_pop_manager.h"
#include "../Rabbit/Rabbit.h"
#include "../Rabbit/Rabbit_Population_Manager.h"
#include "../Newt/Newt.h"
#include "../Newt/Newt_Population_Manager.h"
#include "../Osmia/Osmia.h"
#include "../Osmia/Osmia_Population_Manager.h"
Macros | |
#define | _CRT_SECURE_NO_DEPRECATE |
Functions | |
void | RunTheSim () |
void | CloseDownSim () |
bool | ReadBatchINI () |
void | GetProbeInput_ini () |
void | CreateLandscape () |
bool | CreatePopulationManager () |
void | SpeciesSpecificReporting () |
void | SpeciesSpecificActions () |
bool | BeginningOfMonth () |
void | DumpVegAreaData (int a_day) |
void | PredProbeReportDay0 (int a_time) |
void | ProbeReport (int a_time) |
void | ImpactProbeReport (int a_time) |
int | random (int a_range) |
void | delay (int secs) |
void | FloatToDouble (double &d, float f) |
int | main () |
#define _CRT_SECURE_NO_DEPRECATE |
bool BeginningOfMonth | ( | ) |
Referenced by Population_Manager::ImpactProbeReport(), and Population_Manager::ProbeReport().
void CloseDownSim | ( | ) |
References probe_data::CloseFile(), g_ALandscape, g_AManager, g_cfg, g_NoProbes, g_PredatorManager, g_Species, Landscape::SimulationClosingActions(), and Population_Manager::TheProbe.
Referenced by main().
void CreateLandscape | ( | ) |
References g_ALandscape.
Referenced by main().
bool CreatePopulationManager | ( | ) |
References g_ALandscape, g_AManager, g_Hunter_Population_Manager, g_msg, g_NoOfPredProbes, g_NoProbes, g_PopulationManagerList, g_PredatorManager, g_Species, Population_Manager::OpenTheBreedingPairsProbe(), Population_Manager::OpenTheBreedingSuccessProbe(), Population_Manager::OpenTheFledgelingProbe(), Population_Manager::SetNoProbes(), PopulationManagerList::SetPopulation(), TOP_Beetle, TOP_Dormouse, TOP_Goose, TOP_Hare, TOP_Hunters, TOP_MarshFritillary, TOP_Newt, TOP_Osmia, TOP_Partridge, TOP_Predators, TOP_Rabbit, TOP_RoeDeer, TOP_Skylark, TOP_Spider, TOP_Vole, and MapErrorMsg::Warn().
Referenced by main().
void delay | ( | int | secs | ) |
void DumpVegAreaData | ( | int | a_day | ) |
void FloatToDouble | ( | double & | d, |
float | f | ||
) |
void GetProbeInput_ini | ( | ) |
References g_ALandscape, g_AManager, g_files, g_NoOfPredProbes, g_NoProbes, g_PredatorManager, g_Predfiles, g_ResultsDir, g_Species, probe_data::OpenFile(), Population_Manager::ProbeFileInput(), probe_data::SetFile(), Population_Manager::TheProbe, and Landscape::Warn().
Referenced by main().
void ImpactProbeReport | ( | int | a_time | ) |
Referenced by Population_Manager::SpeciesSpecificReporting().
int main | ( | ) |
References cfg_fixed_random_sequence, CloseDownSim(), CreateLandscape(), CreatePopulationManager(), g_ALandscape, g_AManager, g_cfg, g_msg, GetProbeInput_ini(), ReadBatchINI(), Configurator::ReadSymbols(), RunTheSim(), Landscape::SetThePopManager(), MapErrorMsg::SetWarnLevel(), CfgBool::value(), and WARN_ALL.
void PredProbeReportDay0 | ( | int | a_time | ) |
void ProbeReport | ( | int | a_time | ) |
Referenced by Population_Manager::SpeciesSpecificReporting().
int random | ( | int | a_range | ) |
References g_rand_uni.
Referenced by Landscape::AddBeetleBanks(), Farm::AssignPermanentCrop(), Rabbit_Population_Manager::AssignStaticVariables(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), Landscape::BorderScan(), Skylark_Female::CalculateEggNumber(), Roe_Base::CalculateRoadMortality(), Bembidion_Adult::CanReproduce(), Bembidion_Population_Manager::Catastrophe(), THare_Population_Manager::Catastrophe(), Partridge_Population_Manager::Catastrophe(), Skylark_Population_Manager::Catastrophe(), Vole_Population_Manager::Catastrophe(), Vole_Base::CheckTraps(), Partridge_Covey::ChickExtraMortality(), Partridge_Base::CopyMyself(), Bembidion_Base::CopyMyselfB(), Partridge_Covey::CoveyIndividualEmigrate(), Partridge_Population_Manager::CreateInitialObjects(), Partridge_Population_Manager::CreateObjects(), Vole_Population_Manager::CreateObjects_Init(), Bembidion_Egg_List::DailyMortality(), Partridge_Base::DailyMortality(), Skylark_Base::DailyMortality(), Vole_JuvenileMale::Dispersal(), Vole_Male::Dispersal(), Vole_JuvenileFemale::Dispersal(), Partridge_Covey::DistanceToCovey(), Partridge_Population_Manager::DoAfter(), RoadsideVerge::DoDevelopment(), THare_Population_Manager::DoFirst(), Partridge_Population_Manager::DoFirst(), Rabbit_Population_Manager::DoFirst(), Goose_Population_Manager::DoImmigration(), Vole_Base::DoWalking(), Vole_Base::DoWalkingCorrect(), Vole_Base::Escape(), THare_Population_Manager::ExtraPopMort(), Roe_Fawn::FAOnNewDay(), Roe_Fawn::FARecover(), Roe_Female::FDisperse(), Skylark_Female::FeedYoung(), Roe_Female::FEstablishRange(), Roe_Female::FFeed(), Partridge_Female::FFindingTerritory(), Roe_Female::FGiveBirth(), Partridge_Female::FIncubating(), FarmManager::FindFarmWithOpenness(), FarmManager::FindFarmWithRandom(), Partridge_Covey::FindNeighbour(), FarmManager::FindOpennessFarm(), Vole_Population_Manager::FindOutsideRadiusMale(), Vole_Population_Manager::FindRandomMale(), Vole_Population_Manager::FindWithinRadiusMale(), Partridge_Covey::FlyToFast(), Partridge_Covey::FlyToSlow(), Partridge_Female::FMakingNest(), Roe_Female::FOnNewDay(), THare::Forage(), THare::ForageP(), THare::ForageSquare(), THare::ForageSquareP(), Roe_Female::FRecover(), Roe_Female::FRuminate(), Partridge_Female::FStartingNewBrood(), Roe_Female::FUpdateGestation(), Goose_Population_Manager::GetForageLocIndex(), Goose_Population_Manager::GetLeader(), THare::GetPegDirection(), FarmManager::GetRandomFarmRefnum(), Weather::GetSnow(), Landscape::hb_MarkTheBresenhamWay(), Landscape::hb_StripingDist(), Partridge_Population_Manager::Hunting(), Partridge_Population_Manager::HuntingDifferentiatedBeetleBankArea(), Partridge_Population_Manager::HuntingGrid(), Bembidion_Adult::Init(), THare_Population_Manager::Init(), Bembidion_Population_Manager::Init(), RoeDeer_Population_Manager::Init(), Skylark_Population_Manager::Init(), Vole_Population_Manager::Init(), GeneticMaterial::Initiation(), GeneticMaterial1616::Initiation(), GeneticMaterial256_16::Initiation(), Partridge_Covey::KillChicks(), Landscape::Landscape(), Partridge_Population_Manager::MaleImmigration(), Partridge_Covey::ManagerCheckMerge(), Roe_Male::MDisperse(), Roe_Male::MFeed(), Roe_Male::MOnNewDay(), Partridge_Covey::MoveSelect(), Partridge_Covey::MoveSelectFuzzy(), Bembidion_Adult::MoveTo(), Bembidion_Adult::MoveTo_quality_assess(), Bembidion_Adult::MoveToAggr(), Partridge_Covey::MoveTryExclude(), Partridge_Covey::MoveTryExcludeHarder(), Partridge_Covey::MoveWeighDirection(), Roe_Male::MRecover(), Roe_Male::MRuminate(), GeneticMaterial::Mutation_1(), GeneticMaterial1616::Mutation_1(), GeneticMaterial::Mutation_1ab(), GeneticMaterial::Mutation_2(), GeneticMaterial1616::Mutation_2(), GeneticMaterial::Mutation_3(), GeneticMaterial1616::Mutation_3(), GeneticMaterial256_16::Mutation_3(), GeneticMaterial::Mutation_4(), Partridge_Covey::NestGoodSpot(), Newt_Juvenile::NewtDoWalking(), Newt_Juvenile::NewtDoWalkingCorrect(), Roe_Base::NextStep(), Roe_Male::On_Rank(), Bembidion_Larvae::OnFarmEvent(), Bembidion_Pupae::OnFarmEvent(), Bembidion_Adult::OnFarmEvent(), Hare_Infant::OnFarmEvent(), Hare_Young::OnFarmEvent(), Skylark_Clutch::OnFarmEvent(), Skylark_Nestling::OnFarmEvent(), Skylark_PreFledgeling::OnFarmEvent(), Skylark_Female::OnFarmEvent(), Skylark_Male::OnFarmEvent(), Partridge_Covey::Partridge_Covey(), Partridge_Female::Partridge_Female(), Partridge_Male::Partridge_Male(), SkTerritories::PreProcessLandscape2(), Rabbit_Population_Manager::Rabbit_Population_Manager(), VegElement::RandomVegStartValues(), Landscape::ReadPolys2(), GeneticMaterial::Recombine(), GeneticMaterial1616::Recombine(), GeneticMaterial256_16::Recombine(), Skylark_Adult::ReInit(), Skylark_Nestling::ReInit(), Roe_Female::Roe_Female(), Roe_Male::Roe_Male(), THare::Running(), Roe_Base::Running(), Roe_Fawn::RunTo(), Roe_Base::SeekCover(), Roe_Base::SeekNutri(), Population_Manager::Shuffle(), Skylark_Adult::Skylark_Adult(), Skylark_Nestling::Skylark_Nestling(), Bembidion_Adult::st_Aggregate(), Skylark_Male::st_CaringForYoung(), Bembidion_Pupae::st_Develop(), Hare_Male::st_Developing(), Hare_Female::st_Developing(), Skylark_Nestling::st_Developing(), Bembidion_Adult::st_Dispersal(), Hare_Juvenile::st_Dispersal(), TPredator::st_Dispersal(), Skylark_Female::st_Emigrating(), Skylark_Male::st_Emigrating(), Vole_JuvenileMale::st_Eval_n_Explore(), Vole_Male::st_Eval_n_Explore(), Vole_JuvenileFemale::st_Evaluate_n_Explore(), Vole_Female::st_Evaluate_n_Explore(), Skylark_Male::st_FindingTerritory(), Skylark_Female::st_Floating(), Skylark_Male::st_Floating(), Bembidion_Adult::st_Forage(), Bembidion_Adult::st_Hibernate(), TPredator::st_Hunting(), Skylark_Female::st_Immigrating(), Skylark_Male::st_Immigrating(), Vole_JuvenileMale::st_JuvenileExplore(), Vole_Female::st_Lactating(), TPredator::st_Movement(), Hare_Female::st_ReproBehaviour(), THare::THareInit(), TPredator_Population_Manager::TPredator_Population_Manager(), UnsprayedFieldMargin::UnsprayedFieldMargin(), THare::Walking(), Roe_Base::WalkTo(), and Bembidion_Adult::WinterMort().
bool ReadBatchINI | ( | ) |
References g_files, g_NoOfPredProbes, g_NoProbes, g_Predfiles, g_PredResultsDir, g_ResultsDir, g_Species, and g_torun.
Referenced by main().
void RunTheSim | ( | ) |
References Landscape::DumpVegAreaData(), g_ALandscape, g_AManager, g_date, g_Hunter_Population_Manager, g_PredatorManager, g_Species, g_time, g_torun, g_Year, Population_Manager::Run(), TPredator_Population_Manager::Run(), Population_Manager::SpeciesSpecificReporting(), Landscape::SupplyDayInMonth(), Landscape::SupplyMonth(), Calendar::TickHour(), Calendar::TickMinute10(), and Landscape::TurnTheWorld().
Referenced by main().
void SpeciesSpecificActions | ( | ) |
void SpeciesSpecificReporting | ( | ) |
|
static |
|
extern |
|
extern |
|
extern |
|
extern |
|
static |
|
static |
|
static |
|
static |
Landscape* g_ALandscape |
Referenced by CloseDownSim(), CreateLandscape(), CreatePopulationManager(), GetProbeInput_ini(), main(), and RunTheSim().
ALMaSS_MathFuncs g_AlmassMathFuncs |
This variable provides access the to the internal ALMaSS math functions.
Referenced by Goose_Population_Manager::BangAtPoly(), GooseMemoryMap::ChangeSetFoodRes(), GooseMemoryMap::DecayAllMemory(), Goose_Base::EvaluateForageToHopLoc(), Goose_Population_Manager::FindClosestRoost(), Goose_Base::FlyTo(), Goose_Population_Manager::GetDistToClosestRoost(), Goose_Population_Manager::GetForageLocIndex(), Goose_Base::On_Bang(), and Goose_Base::st_ChooseForageLocation().
Population_Manager* g_AManager |
Referenced by CloseDownSim(), CreatePopulationManager(), GetProbeInput_ini(), main(), and RunTheSim().
char* g_files[100] |
Referenced by GetProbeInput_ini(), and ReadBatchINI().
Hunter_Population_Manager* g_Hunter_Population_Manager |
Referenced by CreatePopulationManager(), and RunTheSim().
unsigned g_NoOfPredProbes |
Referenced by CreatePopulationManager(), GetProbeInput_ini(), and ReadBatchINI().
int g_NoProbes |
Referenced by CloseDownSim(), CreatePopulationManager(), GetProbeInput_ini(), and ReadBatchINI().
PopulationManagerList g_PopulationManagerList |
TPredator_Population_Manager* g_PredatorManager |
Referenced by CloseDownSim(), CreatePopulationManager(), GetProbeInput_ini(), and RunTheSim().
char* g_Predfiles[100] |
Referenced by GetProbeInput_ini(), and ReadBatchINI().
char g_PredResultsDir[255] |
Referenced by ReadBatchINI().
|
extern |
Referenced by random().
const double g_randmaxp = RAND_MAX + 1.0 |
char g_ResultsDir[255] |
Referenced by GetProbeInput_ini(), and ReadBatchINI().
int g_Species |
Referenced by CloseDownSim(), CreatePopulationManager(), GetProbeInput_ini(), ReadBatchINI(), and RunTheSim().
int g_Steps |
int g_time |
Referenced by RunTheSim().
int g_torun |
This variable controls how long the simulation will run for.
Referenced by Goose_Population_Manager::Goose_Population_Manager(), ReadBatchINI(), and RunTheSim().
int g_Year |
Referenced by RunTheSim().